function layer_connections = layerDropout(n1, n2, r)
%*************************************************************************
% generate random dropout from layer to layer
%*************************************************************************

layer_connections = cell(n2, 1);
%stream = RandStream.getGlobalStream;
%reset(stream);
x = rand(n1, n2);
x = x > r;
for i1 = 1:n2
    [rowIdx, ~, ~] = find(x(:, i1));
    layer_connections{i1} = rowIdx;
end
